package mastermind.gui.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import mastermind.gui.Frame;
import mastermind.gui.SettingsFrame;

public class SaveSettingsAction extends AbstractAction{

	private Frame frame;
	private SettingsFrame sframe;
	
	public SaveSettingsAction(Frame frame, SettingsFrame sframe)
	{
		this.frame = frame;
		this.sframe = sframe;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		
		frame.setServerAddress(sframe.getIPAddress());
		frame.setServerPort(sframe.getPort());
		sframe.setVisible(false);
	}

}
